package com.youlu.campus.service.visitor;

import com.youlu.campus.entity.UserPO;
import com.youlu.campus.entity.UserPoints;
import com.youlu.campus.entity.UserPointsDetail;
import com.youlu.campus.entity.VO.req.UserCaReceivePointReq;
import com.youlu.campus.entity.VO.req.UserPointsQuerVO;
import com.youlu.campus.entity.VO.res.UserCaReceivePointRes;
import com.youlu.campus.entity.domain.UserPointsDomain;
import org.springframework.data.domain.Page;

public interface UserPointsService {
    /**
     * 获取我的积分
     *
     * @param userId
     * @return
     */
    UserPoints findByUserId(String userId,String appId);

    /**
     * 积分明细
     *
     * @param req
     * @return
     */
    Page<UserPointsDetail> list(UserPointsQuerVO req);

    /**
     * 累加积分
     *
     * @param req
     * @return
     */
    boolean addPoint(UserPointsDetail req);

    /**
     * 扣减积分
     *
     * @param req
     * @return
     */
    void subPoint(UserPointsDetail req);

    /**
     * 获取我的积分
     *
     * @param userId
     * @return
     */
    UserPointsDomain getMyPoint(String userId,String appId);


    /**
     * 检验积分是否够
     *
     * @param userCaReceivePointReq
     * @return
     */
    UserCaReceivePointRes checkReceiveCaPoint(UserCaReceivePointReq userCaReceivePointReq);

    /**
     * 判断用户是否有积分
     *
     * @param userId
     * @param bizType
     * @return
     */
    boolean hasPoint(String userId,String appId, String bizType);

    /**
     * 获取我的积分
     *
     * @param currentUser
     * @return
     */
    UserPoints findByUserInfo(UserPO currentUser);


}
